n, arr = int(input()), list(map(int, input().strip().split()))  # 输入n和数组
high, low, total = 0, 0, 0  # 初始化high, low, total为0

high = max(arr)
low = min(arr)
total = sum(arr)

print(low, high, total)  # 输出low, high, total
